<?php

class stg_Order extends stg_Object
{
	protected $_object_id;
	protected $_object;
	protected $_player;
	protected $_action;
	protected $_arguments;

	function __construct($universe, $object_id, $player, $action, $arguments) {
		$this->_object_id = $object_id;
		$this->_player = $player;
		$this->_action = $action;
		$this->_arguments = $arguments;
		$this->universe = $universe;
	}
		
	public function execute()
	{
		try
		{
			// Object existence condition
			assert(array_key_exists($this->_object_id, $this->universe->objects_by_id));
			$this->_object = $this->universe->objects_by_id[$this->_object_id];
			// EXECUTE
			$this->_object->execute($this);
		}
		catch (Exception $ex)
		{
			e($ex->getMessage());
		}
	}

}

?>
